﻿using System.Collections.Concurrent;
using System.Collections;
using System;
using CefSharp;

namespace Web_rongmeiti_sys.PublishToRongMeiTi
{
    public class FilterManager
    {
        private static ConcurrentDictionary<ulong, MyResponseFilter> Filters = new ConcurrentDictionary<ulong, MyResponseFilter>();

        public static IResponseFilter? GetResponseFilter(ulong request_Identifier)
        {
            lock (Filters)
            {
                if (Filters.ContainsKey(request_Identifier))
                {
                    return Filters.GetValueOrDefault(request_Identifier);
                }
                MyResponseFilter responseFilter = new MyResponseFilter();
                Filters.TryAdd(request_Identifier, responseFilter);
                return responseFilter;
            }
        }


    }
}
